3.3.40 \(\int \cos (a+b x) \cos (c+d x) \, dx\) [240]

Optimal. Leaf size=43 \[ \frac {\sin (a-c+(b-d) x)}{2 (b-d)}+\frac {\sin (a+c+(b+d) x)}{2 (b+d)} \]

[Out]

1/2*sin(a-c+(b-d)*x)/(b-d)+1/2*sin(a+c+(b+d)*x)/(b+d)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {4666, 2717} \begin {gather*} \frac {\sin (a+x (b-d)-c)}{2 (b-d)}+\frac {\sin (a+x (b+d)+c)}{2 (b+d)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[a + b*x]*Cos[c + d*x],x]

[Out]

Sin[a - c + (b - d)*x]/(2*(b - d)) + Sin[a + c + (b + d)*x]/(2*(b + d))

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 4666

Int[Cos[v_]^(p_.)*Cos[w_]^(q_.), x_Symbol] :> Int[ExpandTrigReduce[Cos[v]^p*Cos[w]^q, x], x] /; ((PolynomialQ[
v, x] && PolynomialQ[w, x]) || (BinomialQ[{v, w}, x] && IndependentQ[Cancel[v/w], x])) && IGtQ[p, 0] && IGtQ[q
, 0]

Rubi steps

\begin {align*} \int \cos (a+b x) \cos (c+d x) \, dx &=\int \left (\frac {1}{2} \cos (a-c+(b-d) x)+\frac {1}{2} \cos (a+c+(b+d) x)\right ) \, dx\\ &=\frac {1}{2} \int \cos (a-c+(b-d) x) \, dx+\frac {1}{2} \int \cos (a+c+(b+d) x) \, dx\\ &=\frac {\sin (a-c+(b-d) x)}{2 (b-d)}+\frac {\sin (a+c+(b+d) x)}{2 (b+d)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.20, size = 43, normalized size = 1.00 \begin {gather*} \frac {\sin (a-c+(b-d) x)}{2 (b-d)}+\frac {\sin (a+c+(b+d) x)}{2 (b+d)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[a + b*x]*Cos[c + d*x],x]

[Out]

Sin[a - c + (b - d)*x]/(2*(b - d)) + Sin[a + c + (b + d)*x]/(2*(b + d))

________________________________________________________________________________________

Maple [A]
time = 0.13, size = 40, normalized size = 0.93

method result size
default \(\frac {\sin \left (a -c +\left (b -d \right ) x \right )}{2 b -2 d}+\frac {\sin \left (a +c +\left (b +d \right ) x \right )}{2 b +2 d}\) \(40\)
risch \(\frac {\sin \left (b x -d x +a -c \right ) b}{2 \left (b -d \right ) \left (b +d \right )}+\frac {\sin \left (b x -d x +a -c \right ) d}{2 \left (b -d \right ) \left (b +d \right )}+\frac {\sin \left (b x +d x +a +c \right ) b}{2 \left (b -d \right ) \left (b +d \right )}-\frac {\sin \left (b x +d x +a +c \right ) d}{2 \left (b -d \right ) \left (b +d \right )}\) \(108\)
norman \(\frac {\frac {2 b \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{b^{2}-d^{2}}-\frac {2 d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{b^{2}-d^{2}}-\frac {2 b \tan \left (\frac {b x}{2}+\frac {a}{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2}-d^{2}}+\frac {2 d \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{b^{2}-d^{2}}}{\left (1+\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\) \(147\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(b*x+a)*cos(d*x+c),x,method=_RETURNVERBOSE)

[Out]

1/2*sin(a-c+(b-d)*x)/(b-d)+1/2*sin(a+c+(b+d)*x)/(b+d)

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 40, normalized size = 0.93 \begin {gather*} \frac {\sin \left (b x + d x + a + c\right )}{2 \, {\left (b + d\right )}} - \frac {\sin \left (-b x + d x - a + c\right )}{2 \, {\left (b - d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)*cos(d*x+c),x, algorithm="maxima")

[Out]

1/2*sin(b*x + d*x + a + c)/(b + d) - 1/2*sin(-b*x + d*x - a + c)/(b - d)

________________________________________________________________________________________

Fricas [A]
time = 2.74, size = 42, normalized size = 0.98 \begin {gather*} \frac {b \cos \left (d x + c\right ) \sin \left (b x + a\right ) - d \cos \left (b x + a\right ) \sin \left (d x + c\right )}{b^{2} - d^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)*cos(d*x+c),x, algorithm="fricas")

[Out]

(b*cos(d*x + c)*sin(b*x + a) - d*cos(b*x + a)*sin(d*x + c))/(b^2 - d^2)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 153 vs. \(2 (32) = 64\).
time = 0.32, size = 153, normalized size = 3.56 \begin {gather*} \begin {cases} x \cos {\left (a \right )} \cos {\left (c \right )} & \text {for}\: b = 0 \wedge d = 0 \\- \frac {x \sin {\left (a - d x \right )} \sin {\left (c + d x \right )}}{2} + \frac {x \cos {\left (a - d x \right )} \cos {\left (c + d x \right )}}{2} + \frac {\sin {\left (c + d x \right )} \cos {\left (a - d x \right )}}{2 d} & \text {for}\: b = - d \\\frac {x \sin {\left (a + d x \right )} \sin {\left (c + d x \right )}}{2} + \frac {x \cos {\left (a + d x \right )} \cos {\left (c + d x \right )}}{2} + \frac {\sin {\left (c + d x \right )} \cos {\left (a + d x \right )}}{2 d} & \text {for}\: b = d \\\frac {b \sin {\left (a + b x \right )} \cos {\left (c + d x \right )}}{b^{2} - d^{2}} - \frac {d \sin {\left (c + d x \right )} \cos {\left (a + b x \right )}}{b^{2} - d^{2}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)*cos(d*x+c),x)

[Out]

Piecewise((x*cos(a)*cos(c), Eq(b, 0) & Eq(d, 0)), (-x*sin(a - d*x)*sin(c + d*x)/2 + x*cos(a - d*x)*cos(c + d*x
)/2 + sin(c + d*x)*cos(a - d*x)/(2*d), Eq(b, -d)), (x*sin(a + d*x)*sin(c + d*x)/2 + x*cos(a + d*x)*cos(c + d*x
)/2 + sin(c + d*x)*cos(a + d*x)/(2*d), Eq(b, d)), (b*sin(a + b*x)*cos(c + d*x)/(b**2 - d**2) - d*sin(c + d*x)*
cos(a + b*x)/(b**2 - d**2), True))

________________________________________________________________________________________

Giac [A]
time = 0.39, size = 40, normalized size = 0.93 \begin {gather*} \frac {\sin \left (b x + d x + a + c\right )}{2 \, {\left (b + d\right )}} + \frac {\sin \left (b x - d x + a - c\right )}{2 \, {\left (b - d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)*cos(d*x+c),x, algorithm="giac")

[Out]

1/2*sin(b*x + d*x + a + c)/(b + d) + 1/2*sin(b*x - d*x + a - c)/(b - d)

________________________________________________________________________________________

Mupad [B]
time = 1.30, size = 84, normalized size = 1.95 \begin {gather*} \frac {b\,\left (\frac {\sin \left (a+c+b\,x+d\,x\right )}{2}+\frac {\sin \left (a-c+b\,x-d\,x\right )}{2}\right )}{b^2-d^2}-\frac {d\,\left (\frac {\sin \left (a+c+b\,x+d\,x\right )}{2}-\frac {\sin \left (a-c+b\,x-d\,x\right )}{2}\right )}{b^2-d^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a + b*x)*cos(c + d*x),x)

[Out]

(b*(sin(a + c + b*x + d*x)/2 + sin(a - c + b*x - d*x)/2))/(b^2 - d^2) - (d*(sin(a + c + b*x + d*x)/2 - sin(a -
 c + b*x - d*x)/2))/(b^2 - d^2)

________________________________________________________________________________________